export function isString(obj) {
  return Object.prototype.toString.call(obj) === '[object String]'
}

export function isObject(obj) {
  return Object.prototype.toString.call(obj) === '[object Object]'
}

export function isHtmlElement(node) {
  return node && node.nodeType === Node.ELEMENT_NODE
}

export const isFunction = (functionToCheck) => {
  var getType = {}
  return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'
}

export const isUndefined = (val) => {
  return val === void 0
}

export const isDefined = (val) => {
  return val !== undefined && val !== null
}

export const isNil = (val) => {
  return val === null
}

export const isEmpty = (val) =>
  (!val && val !== 0) ||
  (Array.isArray(val) && val.length === 0) ||
  (isObject(val) && !Object.keys(val).length)
